package com.dede.lib;

public class myClass {

    static String path1 = "D:\\CloudMusic\\那英,王菲 - 相约一九九八.mp3";
    static String path = "C:\\Users\\Administrator\\Desktop\\test - 副本.mp3";

    public static void main(String... args) {

        try {
            new Test(path1).read();

//
//            String input = "36451348";
//            String key = "3go8&$8*3*3h0k(2)2";
//            byte[] keyBytes = key.getBytes();
//            byte[] searchBytes = input.getBytes();
//
//            for (int i = 0; i < searchBytes.length; ++i) {
//                searchBytes[i] ^= keyBytes[i % keyBytes.length];
//            }
//
//            MessageDigest mdInst = MessageDigest.getInstance("MD5");
//            mdInst.update(searchBytes);
//            byte[] result = Base64.getEncoder().encode(mdInst.digest());
//            String params = new String(result);
//            params = params.replace("+", "-");
//            params = params.replace("/", "_");
//
//            System.out.println("http://m2.music.126.net/" + params + "/" + input + ".mp3");

//            MP3File mp3File = new MP3File(path);
//            TagOptionSingleton.getInstance().setDefaultSaveMode(TagConstant.MP3_FILE_SAVE_OVERWRITE);
//            ID3v2_3 id3v23 = new ID3v2_3();
//            id3v23.setAlbumTitle("luodikaihua");
//            id3v23.setSongTitle("luodikaihua");
//            id3v23.setLeadArtist("luqiaoyin");
//            mp3File.setID3v2Tag(id3v23);

//            ID3v1 id3v1_ = new ID3v1();
//            id3v1_.setAlbumTitle("落地开花");
//            id3v1_.setSongTitle("落地开花");
//            id3v1_.setLeadArtist("卢巧音");
//            id3v1_.setYearReleased("2017");
//            mp3File.setID3v1Tag(id3v1_);

//            mp3File.save();
//
//            if (mp3File.hasID3v2Tag()) {
//                AbstractID3v2 id3v2 = mp3File.getID3v2Tag();
//                System.out.println("id3v2");
//
//                System.out.println(id3v2.getAlbumTitle());//专辑名
//                System.out.println(id3v2.getSongTitle());//歌曲名
//                System.out.println(id3v2.getLeadArtist());//歌手
//            }
//            if (mp3File.hasID3v1Tag()) {
//                ID3v1 id3v1 = mp3File.getID3v1Tag();
//                System.out.println("id3v1");
//
//                System.out.println(id3v1.getAlbumTitle());
//                System.out.println(id3v1.getSongTitle());
//                System.out.println(id3v1.getLeadArtist());
//            }

        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
